﻿using System;
using System.Data;
using System.Web.Caching;
using System.Reflection;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Services.Localization;


namespace gdlmo.DNN.Modules.ImgNews.Data
{
	public abstract class DataProvider
	{
		#region Shared/Static Methods
        // singleton reference to the instantiated object 
		private static DataProvider objProvider = null;

		// constructor
		static DataProvider()
		{
			CreateProvider();
		}

		// dynamically create provider
		private static void CreateProvider()
		{
			objProvider = ((DataProvider)DotNetNuke.Framework.Reflection.CreateObject("data", "gdlmo.DNN.Modules.ImgNews.Data", "gdlmo.DNN.Modules.ImgNews"));
		}

		// return the provider
		public static DataProvider Instance()
		{
			return objProvider;
		}

		#endregion
		#region "ImgNews Abstract Methods"
		public abstract IDataReader GetImgNews(int ImgNewsId,int moduleId);
		public abstract IDataReader ListImgNews();
		public abstract IDataReader ListImgNews(int moduleId);
		public abstract int AddImgNews(int ModuleId , string Title , string ImgLink , string Links , string Target , string IP , string CreateByUser , string Author , bool IsActive , DateTime CreateDate);
		public abstract void UpdateImgNews(int ImgNewsId, int ModuleId , string Title , string ImgLink , string Links , string Target , string IP , string CreateByUser , string Author , bool IsActive , DateTime CreateDate);
		public abstract void DeleteImgNews(int ImgNewsId);
		#endregion
	}
}

